package io;

import java.io.FileNotFoundException;
import java.io.PrintWriter;

/**
 * 打印流测试
 */
public class PrintWriterTest {
    public static void main(String[] args) {
        test();
    }

    private static void test() {
        try (PrintWriter pw = new PrintWriter("/Users/luchuan/IdeaProjects/java-test/print.txt")) {
            pw.write(97); // 输出的是a
            pw.println(97); // 输出的是97
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
